import $http from './interceptor';
import type { AxiosRequestConfig } from 'axios';



export const getLoginCode = (params) =>
    $http({
        url: '/ips/image/code',
        method: 'get',
        params
    } as AxiosRequestConfig);

export const addUser = (data) =>
    $http({
        url: '/ips/user/add',
        method: 'post',
        data
    } as AxiosRequestConfig);



export const delUser = (params) =>
    $http({
        url: '/ips/user/delete',
        method: 'post',
        params
    } as AxiosRequestConfig);
export const editUser = (data) =>
    $http({
        url: '/ips/user/edit',
        method: 'post',
        data
    } as AxiosRequestConfig);


export const userList = (data) =>
    $http({
        url: '/ips/user/listData',
        method: 'post',
        data
    } as AxiosRequestConfig);

export const addRole = (data) =>
    $http({
        url: '/ips/role/add',
        method: 'post',
        data
    } as AxiosRequestConfig);



export const delRole = (params) =>
    $http({
        url: '/ips/role/delete',
        method: 'post',
        params
    } as AxiosRequestConfig);
export const editRole = (data) =>
    $http({
        url: '/ips/role/edit',
        method: 'post',
        data
    } as AxiosRequestConfig);


export const roleList = (data) =>
    $http({
        url: '/ips/role/listData',
        method: 'post',
        data
    } as AxiosRequestConfig);


export const addDict = (data) =>
    $http({
        url: '/ips/dict/add',
        method: 'post',
        data
    } as AxiosRequestConfig);


export const delDict = (params) =>
    $http({
        url: '/ips/dict/delete',
        method: 'post',
        params
    } as AxiosRequestConfig);
export const editDict = (data) =>
    $http({
        url: '/ips/dict/edit',
        method: 'post',
        data
    } as AxiosRequestConfig);


export const dictList = (data) =>
    $http({
        url: '/ips/dict/listPage',
        method: 'post',
        data
    } as AxiosRequestConfig);


export const getDictByType = (params: { dictType: string }) =>
    $http({
        url: '/ips/dict/getByCode',
        method: 'get',
        params,
    }) as unknown;


export const getDitByCode = (params: { dictType: string }) =>
    $http({
        url: '/ips/dict/getByCode',
        method: 'post',
        params,
    }) as unknown;

export const listModuleByRoleId = (params: { dictType: string }) =>
    $http({
        url: '/ips/role/listModuleByRoleId',
        method: 'post',
        params,
    }) as unknown;

export const listAllModule = (params: { dictType: string }) =>
    $http({
        url: '/ips/module/listAllModule',
        method: 'post',
        params,
    }) as unknown;
export const login = (data: { dictType: string }) =>
    $http({
        url: '/ips/login',
        method: 'post',
        data,
    }) as unknown;


export const addProject = (data: { dictType: string }) =>
    $http({
        url: '/ips/project/add',
        method: 'post',
        data,
    }) as unknown;

export const editProject = (data: { dictType: string }) =>
    $http({
        url: '/ips/project/update',
        method: 'post',
        data,
    }) as unknown;

export const getProjectList = (data: { dictType: string }) =>
    $http({
        url: '/ips/project/listData',
        method: 'post',
        data,
    }) as unknown;

export const getProjectUsers = (params: { dictType: string }) =>
    $http({
        url: '/ips/project/getProjectUsers',
        method: 'get',
        params,
    }) as unknown;

export const addProjectUser = (data: { dictType: string }) =>
    $http({
        url: '/ips/project/addProjectUser',
        method: 'post',
        data,
    }) as unknown;

export const removeProjectUser = (data: { dictType: string }) =>
    $http({
        url: '/ips/project/removeProjectUser',
        method: 'post',
        data,
    }) as unknown;
export const deleteProject = (params: { dictType: string }) =>
    $http({
        url: '/ips/project/delete',
        method: 'post',
        params,
    }) as unknown;

export const addRoad = (data: { dictType: string }) =>
    $http({
        url: '/ips/road/add',
        method: 'post',
        data,
    }) as unknown;
export const exportInspectData = (params: { dictType: string }) =>
    $http({
        url: '/ips/road/exportInspectData',
        method: 'get',
        params,
    }) as unknown;

export const importRoadFile = (data: { dictType: string }) =>
    $http({
        url: '/ips/road/importFile',
        method: 'post',
        data,
    }) as unknown;

export const editRoad = (data: { dictType: string }) =>
    $http({
        url: '/ips/road/update',
        method: 'post',
        data,
    }) as unknown;

export const getRoadList = (data: { dictType: string }) =>
    $http({
        url: '/ips/road/listData',
        method: 'post',
        data,
    }) as unknown;

export const deleteRoad = (params: { dictType: string }) =>
    $http({
        url: '/ips/road/delete',
        method: 'post',
        params,
    }) as unknown;


export const getAllDataStatus = (params={}) =>
    $http({
        url: '/ips/common/getAllDataStatus',
        method: 'get',
        params,
    }) as unknown;

export const getUserDataStatus = (params={}) =>
    $http({
        url: '/ips/common/getUserDataStatus',
        method: 'get',
        params,
    }) as unknown;

export const getStatusActionMaps = (params={}) =>
    $http({
        url: '/ips/common/getStatusActionMaps',
        method: 'get',
        params,
    }) as unknown;


export const getLoginUserProjects = (params={}) =>
    $http({
        url: '/ips/project/getLoginUserProjects',
        method: 'get',
        params,
    }) as unknown;


export const getPipelineData = (data={}) =>
    $http({
        url: '/ips/pipeline/listData',
        method: 'post',
        data,
    }) as unknown;
export const getPipelineDetail = (params={}) =>
    $http({
        url: '/ips/pipeline/getDataDetail',
        method: 'get',
        params,
    }) as unknown;


export const createPipeline = (data={}) =>
    $http({
        url: '/ips/pipeline/createData',
        method: 'post',
        data,
    }) as unknown;

export const batchUpadatePipeline = (data={}) =>
    $http({
        url: '/ips/pipeline/batchUpdate',
        method: 'post',
        data,
    }) as unknown;


export const pipelineProcess = (data={}) =>
    $http({
        url: '/ips/pipeline/process',
        method: 'post',
        data,
    }) as unknown;

export const getCombDetail = (params={}) =>
    $http({
        url: '/ips/inspect/pipeline/getCombDetail',
        method: 'get',
        params,
    }) as unknown;



export const getpipePointData = (data={}) =>
    $http({
        url: '/ips/pipepoint/listData',
        method: 'post',
        data,
    }) as unknown;
export const getpipePointDetail = (params={}) =>
    $http({
        url: '/ips/pipepoint/getDataDetail',
        method: 'get',
        params,
    }) as unknown;


export const createpipePoint = (data={}) =>
    $http({
        url: '/ips/pipepoint/createData',
        method: 'post',
        data,
    }) as unknown;

export const batchUpadatepipePoint = (data={}) =>
    $http({
        url: '/ips/pipepoint/batchUpdate',
        method: 'post',
        data,
    }) as unknown;


export const pipePointProcess = (data={}) =>
    $http({
        url: '/ips/pipepoint/process',
        method: 'post',
        data,
    }) as unknown;

export const getCombDetailPoint = (params={}) =>
    $http({
        url: '/ips/inspect/pipepoint/getCombDetail',
        method: 'get',
        params,
    }) as unknown;


export const getObsConfig = (params={}) =>
    $http({
        url: '/ips/common/getObsConfig',
        method: 'get',
        params,
    }) as unknown;


export const saveLineData = (data={}) =>
$http({
    url: '/ips/inspect/pipeline/saveLineData',
    method: 'post',
    data,
}) as unknown;


export const savePointData = (data={}) =>
$http({
    url: '/ips/inspect/pipepoint/savePointData',
    method: 'post',
    data,
}) as unknown;

export const getFlawLevel = () =>
    $http({
        url: '/ips/app/inspect/line/getFlawLevel',
        method: 'get',
    }) as unknown;


export const exportPointData = (data={}) =>
    $http({
        url: '/ips/pipepoint/exportData',
        method: 'post',
        data,
    }) as unknown;


    export const exportPipetData = (data={}) =>
        $http({
            url: '/ips/pipeline/exportData',
            method: 'post',
            data,
        }) as unknown;


        export const listByPoint = (params={}) =>
            $http({
                url: '/ips/pipeline/listByPoint',
                method: 'get',
                params,
            }) as unknown;


